<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jq/jquery1.9/jquery-1.9.0.js"></script>
    <script>
        $(function(){
            $("li").click(function(){
                var arrs=["red","green","yellow","orange","pink"];
                // console.log($(this).index());//查找当前元素在同级别中的索引值
                // console.log($("ul li").index(this));//查找当前元素的索引值
                $(this).css("color",arrs[$(this).index()]);
                
            });
        });
    </script>
</head>
<body>
    <ul>
        <li>li01</li>
        <li>li02</li>
        <li>li03</li>
        <li>li04</li>
        <li>li05</li>
    </ul>
</body>
</html>